﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Invoicing.Model.Members;
using Invoicing.Command.Members;
using Utils;
namespace Invoicing.Logic.Members
{
    public class CustomerLogic
    {
        public static CustomerModel CreateNew(CustomerModel model)
        {
            model.Pinyin = model.RealName.GetPyString();
            return CustomerCommand.CreateNew(model);
        }

        public static void Update(CustomerModel model)
        {
            model.Pinyin = model.RealName.GetPyString();
            CustomerCommand.Update(model);
        }


        public static CustomerModel GetModel(int id, bool getBalance = false)
        {
            return CustomerCommand.GetModel(id,getBalance);
        }

        public static CustomerCollection GetCustomers(CustomerQuery sea)
        {
            return CustomerCommand.GetCustomers(sea);
        }

        public static void Delete(int id) {
            CustomerCommand.Delete(id);
        }

    }
}
